//
//  BaseNavigationController.m
//  StaffTax
//
//  Created by 侯伟 on 2020/1/3.
//  Copyright © 2020 侯伟. All rights reserved.
//

#import "BaseNavigationController.h"

@interface BaseNavigationController ()<UINavigationControllerDelegate>

/// 返回按钮
@property(nonatomic,strong)UIBarButtonItem* backItem;


@end

@implementation BaseNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.delegate = self;
    self.interactivePopGestureRecognizer.delegate = (id)self;
}

- (void)hiddenNavigationBarSeparatorLine:(BOOL)hidden {
    
    [self.navigationBar setShadowImage:[UIImage new]];
    [self.navigationBar setBackgroundImage:[UIImage new] forBarPosition:(UIBarPositionBottom) barMetrics:(UIBarMetricsDefault)];
                                                                                
    if ([self.navigationBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)]) {
        NSArray *list=self.navigationBar.subviews;
        for (id obj in list) {
            if ([obj isKindOfClass:[UIView class]]) {
                UIView *imageView=(UIView *)obj;
                NSArray *list2=imageView.subviews;
                for (id obj2 in list2) {
                    if ([obj2 isKindOfClass:[UIImageView class]]) {
                        UIImageView *imageView2=(UIImageView *)obj2;
                        imageView2.hidden = (imageView2.bounds.size.height < 1)&&hidden;
                    }
                }
            }
        }
    }
}

#pragma mark --UINavigationControllerDelegate

- (void)navigationController:(UINavigationController *)navigationController willShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
}

@end
